A Structured Approach for Developing Concurrent Programs in Java

نویسنده

  • Masaaki Mizuno
چکیده

In recent years, concurrent programming has become the norm rather than the exception in many applications. In particular, popularity of the Java programming language has accelerated this trend. Most textbooks on Operating Systems and concurrent programming teach concurrent programming by demonstrating solutions for some well-known problems, such as the producer/consumer, readers/writers, and dining philosophers problems. A more systematic and formal approach to develop concurrent programs is presented in [1, 2]. In this approach, for a given problem, we first specify a global invariant that implies the safety property. Then, we develop a so-called coarse-grained solution using the two synchronization constructs: < await B → S > and < S >. Using Programming Logic, the global invariant is formally verified in the coarse-grained solution. Finally, the coarse-grained solution is mechanically translated to a fine-grained semaphore or monitor program that maintains the global invariant. This approach has many advantages. First, this is a formal approach that enables verification of programs being developed. Second, the most important activity in the programming process lies at a high level; namely, specifying global invariants. Once an appropriate global invariant is specified, much of the rest of the process is mechanical. Furthermore, global invariants and coarsegrained solutions are platform (synchronization primitive) independent. Thus, if the platform is switched from a semaphore-based to a monitor-based system, we only need to translate the existing coarse-grained solution to a monitor-based fine-grained program. The Java programming language encourages the use of multiple threads. Therefore, as Java’s popularity grows, concurrent programming using Java synchronization primitives will become more important. Java provides monitor-like synchronization primitives. However, these primitives have limitations. Each Java monitor object can only have one condition variable, which is associated with the object itself; all waits and signals (called notify in Java) refer to it. The translation

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Framework of Concurrent Mechanism Based on Java Multithread

The continuously increased demand for paralleling multitask in domains such as grid computing and cloud computing has significantly promoted research on concurrent mechanism and concurrent programming. The Java programming language supports multithread mechanism for developing paralleling programs, however, it is difficult to apply Java concurrent primitives to specific problems. Thus, for the ...

متن کامل

Design of a Toolset for Dynamic Analysis of Concurrent Java Program

The Java language supports the use of monitors, sockets, and remote method invocation for concurrent programming. Also, Java classes can be defined to simulate other types of concurrent constructs. However, concurrent Java programs, like other concurrent programs, are difficult to specify, design, code, test and debug. In this paper, we describe the design of a toolset, called JaDA (Java Dynami...

متن کامل

JACK: A Framework for Process Algebra Implementation in Java

The construction of concurrent programs is especially complex due mainly to the inherent non-determinism of their execution, which makes it difficult to repeat test scenarios. Process algebras have been used to design and reason about these programs. This paper presents an approach to developing concurrent programs using a set of process algebra constructs implemented as an object-oriented fram...

متن کامل

Concurrency Manager

The advent of web–based information systems significantly increased the number of concurrent programs. Concurrent programs must control concurrency to guarantee safe implementations, which avoid interference that lead systems to inconsistent states and behaviors. To implement some of these controls we need to use programming language features, such as blocking methods to avoid their concurrent ...

متن کامل

Slicing Concurrent Java Programs

Although many slicing algorithms have been proposed for object-oriented programs, no slicing algorithm has been proposed which can be used to handle the problem of slicing concurrent Java programs correctly. In this paper, we propose a slicing algorithm for concurrent Java programs. To slice concurrent Java programs, we present a dependence-based representation called multithreaded dependence g...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Inf. Process. Lett.

دوره 69  شماره 

صفحات  -

تاریخ انتشار 1999